.class Lorg/acra/f;
.super Ljava/lang/Object;
.source "SourceFile"

# interfaces
.implements Landroid/view/View$OnClickListener;


# instance fields
.field final synthetic a:Lorg/acra/CrashReportDialog;


# direct methods
.method constructor <init>(Lorg/acra/CrashReportDialog;)V
    .locals 0
    .parameter

    .prologue
    .line 150
    iput-object p1, p0, Lorg/acra/f;->a:Lorg/acra/CrashReportDialog;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onClick(Landroid/view/View;)V
    .locals 7
    .parameter

    .prologue
    const/4 v6, 0x1

    .line 155
    iget-object v0, p0, Lorg/acra/f;->a:Lorg/acra/CrashReportDialog;

    invoke-static {v0}, Lorg/acra/CrashReportDialog;->a(Lorg/acra/CrashReportDialog;)Landroid/widget/EditText;

    move-result-object v0

    if-eqz v0, :cond_1

    iget-object v0, p0, Lorg/acra/f;->a:Lorg/acra/CrashReportDialog;

    invoke-static {v0}, Lorg/acra/CrashReportDialog;->a(Lorg/acra/CrashReportDialog;)Landroid/widget/EditText;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v0

    .line 159
    :goto_0
    iget-object v1, p0, Lorg/acra/f;->a:Lorg/acra/CrashReportDialog;

    invoke-static {v1}, Lorg/acra/CrashReportDialog;->b(Lorg/acra/CrashReportDialog;)Landroid/content/SharedPreferences;

    move-result-object v1

    if-eqz v1, :cond_2

    iget-object v1, p0, Lorg/acra/f;->a:Lorg/acra/CrashReportDialog;

    invoke-static {v1}, Lorg/acra/CrashReportDialog;->c(Lorg/acra/CrashReportDialog;)Landroid/widget/EditText;

    move-result-object v1

    if-eqz v1, :cond_2

    .line 160
    iget-object v1, p0, Lorg/acra/f;->a:Lorg/acra/CrashReportDialog;

    invoke-static {v1}, Lorg/acra/CrashReportDialog;->c(Lorg/acra/CrashReportDialog;)Landroid/widget/EditText;

    move-result-object v1

    invoke-virtual {v1}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v1

    .line 161
    iget-object v2, p0, Lorg/acra/f;->a:Lorg/acra/CrashReportDialog;

    invoke-static {v2}, Lorg/acra/CrashReportDialog;->b(Lorg/acra/CrashReportDialog;)Landroid/content/SharedPreferences;

    move-result-object v2

    invoke-interface {v2}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v2

    .line 162
    const-string v3, "acra.user.email"

    invoke-interface {v2, v3, v1}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 163
    invoke-interface {v2}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 168
    :goto_1
    new-instance v2, Lorg/acra/l;

    iget-object v3, p0, Lorg/acra/f;->a:Lorg/acra/CrashReportDialog;

    invoke-virtual {v3}, Lorg/acra/CrashReportDialog;->getApplicationContext()Landroid/content/Context;

    move-result-object v3

    invoke-direct {v2, v3}, Lorg/acra/l;-><init>(Landroid/content/Context;)V

    .line 170
    :try_start_0
    sget-object v3, Lorg/acra/ACRA;->LOG_TAG:Ljava/lang/String;

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "Add user comment to "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    iget-object v5, p0, Lorg/acra/f;->a:Lorg/acra/CrashReportDialog;

    iget-object v5, v5, Lorg/acra/CrashReportDialog;->a:Ljava/lang/String;

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 171
    iget-object v3, p0, Lorg/acra/f;->a:Lorg/acra/CrashReportDialog;

    iget-object v3, v3, Lorg/acra/CrashReportDialog;->a:Ljava/lang/String;

    invoke-virtual {v2, v3}, Lorg/acra/l;->a(Ljava/lang/String;)Lorg/acra/b/c;

    move-result-object v3

    .line 172
    sget-object v4, Lorg/acra/ReportField;->USER_COMMENT:Lorg/acra/ReportField;

    invoke-virtual {v3, v4, v0}, Lorg/acra/b/c;->put(Ljava/lang/Enum;Ljava/lang/Object;)Ljava/lang/Object;

    .line 173
    sget-object v0, Lorg/acra/ReportField;->USER_EMAIL:Lorg/acra/ReportField;

    invoke-virtual {v3, v0, v1}, Lorg/acra/b/c;->put(Ljava/lang/Enum;Ljava/lang/Object;)Ljava/lang/Object;

    .line 174
    iget-object v0, p0, Lorg/acra/f;->a:Lorg/acra/CrashReportDialog;

    iget-object v0, v0, Lorg/acra/CrashReportDialog;->a:Ljava/lang/String;

    invoke-virtual {v2, v3, v0}, Lorg/acra/l;->a(Lorg/acra/b/c;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    .line 180
    :goto_2
    sget-object v0, Lorg/acra/ACRA;->LOG_TAG:Ljava/lang/String;

    const-string v1, "About to start SenderWorker from CrashReportDialog"

    invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    .line 181
    invoke-static {}, Lorg/acra/ACRA;->getErrorReporter()Lorg/acra/ErrorReporter;

    move-result-object v0

    const/4 v1, 0x0

    invoke-virtual {v0, v1, v6}, Lorg/acra/ErrorReporter;->a(ZZ)Lorg/acra/aa;

    .line 184
    invoke-static {}, Lorg/acra/ACRA;->getConfig()Lorg/acra/c;

    move-result-object v0

    invoke-virtual {v0}, Lorg/acra/c;->u()I

    move-result v0

    .line 185
    if-eqz v0, :cond_0

    .line 186
    iget-object v1, p0, Lorg/acra/f;->a:Lorg/acra/CrashReportDialog;

    invoke-virtual {v1}, Lorg/acra/CrashReportDialog;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    invoke-static {v1, v0, v6}, Lorg/acra/d/l;->a(Landroid/content/Context;II)V

    .line 188
    :cond_0
    iget-object v0, p0, Lorg/acra/f;->a:Lorg/acra/CrashReportDialog;

    invoke-virtual {v0}, Lorg/acra/CrashReportDialog;->finish()V

    .line 189
    return-void

    .line 155
    :cond_1
    const-string v0, ""

    goto/16 :goto_0

    .line 165
    :cond_2
    const-string v1, ""

    goto :goto_1

    .line 175
    :catch_0
    move-exception v0

    .line 176
    sget-object v1, Lorg/acra/ACRA;->LOG_TAG:Ljava/lang/String;

    const-string v2, "User comment not added: "

    invoke-static {v1, v2, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_2
.end method
